﻿
@{
    ViewData["Title"] = "克隆按钮";
    Layout = "~/Views/Shared/_ManageFormLayout.cshtml";
}


<form id="form1">
    <tree-collapse-toggle items="@ViewBag.Items" class="mdui-list" mdui-collapse></tree-collapse-toggle>
</form>

@section Scripts{
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}

    <script>
        //var strategoryId = $.request('id');
        var moduleId = $.request('moduleId');
        var parentId = $.request('parentId');
        $(function () {
            
        });

        function submitForm(index) {
            if (!$("#form1").valid()) {
                return false;
            }
            var postData = $('#form1').formSerialize();

            var vals = $('input:checkbox[name="permission"]:checked').map(function (index, elem) {
                return $(elem).val();
            }).get().join(',');
            postData['permissions'] = vals;

            $.submitForm({
                url: "/SystemManage/ModuleButton/CloneButtonSubmit?moduleId=" + moduleId + "&parentId=" + parentId,
                param: postData,
                success: function () {
                    top.frames['layui-layer-iframe' + index].location.reload();
                }
            });

        };
    </script>
}